home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / clue.lha / clue / gray.l < prev    next >
Lisp/Scheme  |  1989-07-12  |  3KB  |  170 lines

  1. ;;; -*- Mode:Lisp; Package:CLUEI; Syntax:COMMON-LISP; Base:10; Lowercase:T -*-
  2.  
  3. ;;; Graying stipple patterns
  4.  
  5. ;;;
  6. ;;;             TEXAS INSTRUMENTS INCORPORATED
  7. ;;;                  P.O. BOX 2909
  8. ;;;                   AUSTIN, TEXAS 78769
  9. ;;;
  10. ;;; Copyright (C) 1987 Texas Instruments Incorporated.
  11. ;;;
  12. ;;; Permission is granted to any individual or institution to use, copy, modify,
  13. ;;; and distribute this software, provided that this complete copyright and
  14. ;;; permission notice is maintained, intact, in all copies and supporting
  15. ;;; documentation.
  16. ;;;
  17. ;;; Texas Instruments Incorporated provides this software "as is" without
  18. ;;; express or implied warranty.
  19. ;;;
  20.  
  21. ;;; Some common grays
  22. ;;; These are used to draw gray stipple patterns onto the screen.
  23. ;;; Grays with an "R" on the end have regular patterns (grid-like)
  24. ;;; Other grays (without the "R") have pixels offset to avoid the grid look.
  25.  
  26. (in-package 'cluei :use '(lisp xlib))
  27.  
  28. (export '(defimage 0%gray 6%grayr 6%gray 12%grayr 12%gray 25%grayr 25%gray 37%grayr 37%gray
  29.       33%gray 50%grayr 50%gray 66%gray 62%grayr 62%gray 75%grayr 75%grayh 75%gray
  30.       88%grayr 88%gray 93%grayr 93%gray 100%gray))
  31.  
  32. (defvar *bitmap-images* nil "List of defined bitmap images")
  33.  
  34. (defmacro defimage (name &optional plist &body patterns)
  35.   (when (or (typep plist 'bit-vector)
  36.         (and (consp plist) (eq (car plist) 'quote) (typep (cadr plist) 'bit-vector)))
  37.     (push plist patterns)
  38.     (setq plist nil))
  39.   `(progn
  40.      (pushnew ',name *bitmap-images*)
  41.      (defparameter ,name (bitmap-image '(:name ,name ,@plist) ,@patterns))))
  42.  
  43. (defimage 100%gray
  44.   '#*1)
  45.  
  46. (defimage 93%gray
  47.   '#*01111111
  48.   '#*11111111
  49.   '#*11110111
  50.   '#*11111111)
  51.  
  52. (defimage 93%grayr
  53.   '#*0111
  54.   '#*1111
  55.   '#*1111
  56.   '#*1111)
  57.  
  58. (defimage 88%gray
  59.   '#*0111
  60.   '#*1111
  61.   '#*1101
  62.   '#*1111)
  63.  
  64. (defimage 88%grayr
  65.   '#*0111
  66.   '#*1111
  67.   '#*0111
  68.   '#*1111)
  69.  
  70. (defimage 75%gray
  71.   '#*0111
  72.   '#*1101
  73.   '#*0111
  74.   '#*1101)
  75.  
  76. (defimage 75%grayh
  77.   '#*0111
  78.   '#*1101
  79.   '#*1011
  80.   '#*1110)
  81.  
  82. (defimage 75%grayr
  83.   '#*0101
  84.   '#*1111
  85.   '#*0101
  86.   '#*1111)
  87.  
  88. (defimage 62%gray
  89.   '#*0111
  90.   '#*1010
  91.   '#*1101
  92.   '#*1010)
  93.  
  94. (defimage 62%grayr
  95.   '#*0111
  96.   '#*1010
  97.   '#*0111
  98.   '#*1010)
  99.  
  100. (defimage 66%gray
  101.   '#*011
  102.   '#*101
  103.   '#*110) ;; Very SLOW
  104.  
  105. (defimage 50%gray
  106.   '#*01
  107.   '#*10)
  108.  
  109. (defimage 50%grayr
  110.   '#*10
  111.   '#*10)
  112.  
  113. ;; The rest are just reversals of the above
  114. (defimage 33%gray
  115.   '#*100
  116.   '#*010
  117.   '#*001) ;; Very SLOW
  118.  
  119. (defimage 37%gray
  120.   '#*1000
  121.   '#*0101
  122.   '#*0010
  123.   '#*0101)
  124.  
  125. (defimage 37%grayr
  126.   '#*1000
  127.   '#*0101
  128.   '#*1000
  129.   '#*0101)
  130.  
  131. (defimage 25%gray
  132.   '#*1000
  133.   '#*0010
  134.   '#*1000
  135.   '#*0010)
  136.  
  137. (defimage 25%grayr
  138.   '#*1010
  139.   '#*0000
  140.   '#*1010
  141.   '#*0000)
  142.  
  143. (defimage 12%gray
  144.   '#*1000
  145.   '#*0000
  146.   '#*0010
  147.   '#*0000)
  148.  
  149. (defimage 12%grayr
  150.   '#*1000
  151.   '#*0000
  152.   '#*1000
  153.   '#*0000)
  154.  
  155. (defimage 6%gray
  156.   '#*10000000
  157.   '#*00000000
  158.   '#*00001000
  159.   '#*00000000)
  160.  
  161. (defimage 6%grayr
  162.   '#*1000
  163.   '#*0000
  164.   '#*0000
  165.   '#*0000)
  166.  
  167. (defimage 0%gray
  168.   '#*0)
  169.  
  170.